import request from '@/utils/request'

// 创建销售记录
export function createStorageSaleRecord(data) {
  return request({
    url: '/pekingfish/storage-sale-record/create',
    method: 'post',
    data: data
  })
}

// 更新销售记录
export function updateStorageSaleRecord(data) {
  return request({
    url: '/pekingfish/storage-sale-record/update',
    method: 'put',
    data: data
  })
}

// 删除销售记录
export function deleteStorageSaleRecord(id) {
  return request({
    url: '/pekingfish/storage-sale-record/delete?id=' + id,
    method: 'delete'
  })
}

// 获得销售记录
export function getStorageSaleRecord(id) {
  return request({
    url: '/pekingfish/storage-sale-record/get?id=' + id,
    method: 'get'
  })
}

// 获得销售记录分页
export function getStorageSaleRecordPage(query) {
  return request({
    url: '/pekingfish/storage-sale-record/page',
    method: 'get',
    params: query
  })
}

// 导出销售记录 Excel
export function exportStorageSaleRecordExcel(query) {
  return request({
    url: '/pekingfish/storage-sale-record/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
